package com.tang.lts.core.biz.logger.console;

import com.alibaba.fastjson.JSON;
import com.tang.lts.core.biz.logger.JobLogger;
import com.tang.lts.core.biz.logger.domain.JobLogPo;

import java.util.List;
import java.util.logging.Logger;

/**
 * @author Tang
 * @classname ConsoleJobLogger
 * @description [  ]
 * @date 2022/5/5 21:05
 */
public class ConsoleJobLogger implements JobLogger {

    private static Logger logger = Logger.getLogger("ConsoleJobLogger");

    @Override
    public void log(JobLogPo jobLogPo) {
        logger.info(JSON.toJSONString(jobLogPo));
    }

    @Override
    public void log(List<JobLogPo> jobLogPos) {
        for (JobLogPo jobLogPo : jobLogPos) {
            log(jobLogPo);
        }
    }
}